<?php
/**
 * Side Box Template
 *
 * @package templateSystem
 * @copyright Copyright 2009 Bouncing Limited, Philip Clarke
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 */


$content = '
<div id="messengerLiveContent" class="sideBoxContent">';

if(MESSENGER_STYLE != 'Button'){

$content .= '<center><a target="_blank" href="http://settings.messenger.live.com/Conversation/IMMe.aspx?invitee='.MESSENGER_INVITEE.'&mkt=en-GB"><img style="border-style: none;" src="http://messenger.services.live.com/users/'.MESSENGER_INVITEE.'/presenceimage?mkt=en-GB" width="16" height="16" /></a></center>';

}else{

$content .= '<center><script type="text/javascript" src="http://settings.messenger.live.com/controls/1.0/PresenceButton.js"></script>
<div
  id="Microsoft_Live_Messenger_PresenceButton_'.preg_replace('/^([^@]*).*/i', '\1', MESSENGER_INVITEE).'"
  msgr:width="100"
  msgr:backColor="#D7E8EC"
  msgr:altBackColor="#FFFFFF"
  msgr:foreColor="#424542"
  msgr:conversationUrl="http://settings.messenger.live.com/Conversation/IMMe.aspx?invitee='.MESSENGER_INVITEE.'&mkt=en-GB"></div>
<script type="text/javascript" src="http://messenger.services.live.com/users/'.MESSENGER_INVITEE.'/presence?dt=&mkt=en-GB&cb=Microsoft_Live_Messenger_PresenceButton_onPresence"></script></center>';

}

if(MESSENGER_STYLE != 'Button'){

$content .= '<div id="messOffline">'.MESSENGER_LIVE_BOX_TEXT_ICON.'</div>' ;

}else{

$effect = ' style="display:none"' ;

$content .= '<div id="messOffline">'.MESSENGER_LIVE_BOX_TEXT_OFFLINE.'</div>' ;

$content .= '<div id="messOnline"'.$effect.'>'.MESSENGER_LIVE_BOX_TEXT_ONLINE.'</div>' ;


$content .= '</div>
<script language="javascript">
$().ready(
function(){
  if($(\'#messengerLiveContent img\').is(\'img[title=Online]\')){
    $(\'#messOffline\').hide();'.
    ( ($current_page ==  'index' && !isset($_GET['cPath'])) ? '$(\'#messOnline\').slideDown("slow");' : '$(\'#messOnline\').show();' ).
    '
  }else{
  $(\'#messengerlive\').hide();
  }
}
)
</script>
';

}
